<?phpclass Parser extends CI_Model {	function __construct() {		parent::__construct();	}		public function enline($source) {		str_replace('\r', '<br />', $source);		return $source;	}		public function shorten($source, $len = 200) {		$ret = $this->utf8cut($source, $len);		if(strlen($source) > strlen($ret)) $ret .= "...";		return $ret;	}	private function utf8cut($source, $num) {		$ret = '';				for($i = 0, $n = 0; $i < strlen($source), $n < $num; $n ++) {			$code = Ord(substr($source, $i, 1));						if($code >= 224) {				$ret .= substr($source, $i, 3);				$i   += 3;			} else if ($code >= 192) {				$ret .= substr($source, $i, 2);				$i   += 2;			} else {				$ret .= substr($source, $i, 1);				$i   += 1;			}		}		return $ret;	}	private function convertbr($source) {		str_replace('\n', '<br />', $source);		return $source;	}};